#!/usr/bin/env php
<?php
/**
 * init.php
 *
 * @author: cnx7 <zysafe@live.cn> 2018-05-06
 */

defined('ROOT_PATH') or define('ROOT_PATH', __DIR__);

# define
require ROOT_PATH . '/common/config/define.php';

# yii framework
require ROOT_PATH . '/vendor/autoload.php';
require ROOT_PATH . '/vendor/yiisoft/yii2/Yii.php';

Yii::setAlias('common', ROOT_PATH . '/common');

$config = yii\helpers\ArrayHelper::merge(
    require(ROOT_PATH . '/common/config/web.php'),
    require(ROOT_PATH . '/common/config/console.php')
);


$application = new yii\console\Application($config);
$exitCode = $application->run();
exit($exitCode);
